<template>
	<view class="panel_container" v-if="showList">
		<view class="panel_box"  v-for="(item,index) in pageList"  :key="index"   @click="goDetail(item.id)">
			<view class="panel_box_top">
				<!--<view class="panel_box_img" >
					<image mode="aspectFill" :src="host+'/static/banner/banner1.png'"></image>
				</view>-->
				
				<view class="panel_box_title">
					<view class="panel_box_name">{{item.name}}</view>
					<view class="panel_box_time">{{item.create_date}}</view>
				</view>
				
				<view class="panel_box_more"  @click="goDetail(item.id)">
					<!--<image mode="aspectFit" src="../../static/icons/more.png"></image>-->
					<uni-icons type="forward" color="#9a9a9a" :size="iconSize[60]" />
				</view>
			</view>
			
			
			<view class="panel_box_swiper" v-if="item.image_list&&item.image_list.length>0">
				<swiper class="swiper" indicator-dots="true" indicator-active-color="#910a15">
					<swiper-item v-for="(i,k) in item.image_list"  :key="k">
						<image mode="aspectFill" :src="i.url"></image>
					</swiper-item>
				</swiper>
			</view>
			
			<view class="panel_box_dsc">
				{{item.descript}}
			</view>
		
			<view class="panel_box_oper" v-if="showOperate">
				<view class="oper_item" >
					<view class="oper_item_box">
						<view class="oper_icon">
							<uni-icons :type="icons[1].type" :color="item.select?'#E54D42':'#A9A9A9'" :size="icons[1].size" />
						</view>
						<view  class="oper_txt">1</view>
					</view>
				</view>
				<view class="oper_item" >
					<view class="oper_item_box">
						<view class="oper_icon">
							<uni-icons :type="icons[0].type" color="#A9A9A9" :size="icons[0].size" />
						</view>
						<view  class="oper_txt">1111</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	import  parentPage from '@/common/parent-page.js';
	var _self;
	export default {
		extends:parentPage,
		name: 'PageList',
		props: {
			pageUrl:{
				type:String,
				default:""
			},
			dataList: {
				type: Array,
				default: function(){
					return [];
				}
			},
			showOperate:{
				type:Boolean,
				default:false
			}
		},
		data() {
			return {
				iconSize:{"50":uni.upx2px(50),"60":uni.upx2px(60),"40":uni.upx2px(40)},
				showList:false,
				memberOperate:null,
				pageList:this.dataList,
				detailUrl:this.pageUrl,
				icons:[
					{type:"chat-filled",size:uni.upx2px(38)},
					{type:"heart-filled",size:uni.upx2px(38)},
					{type:"compose",size:uni.upx2px(35)},
				],
				detail:null,
				
			}
		},
		
		
		watch:{
			dataList(val){
				this.pageList=val;
				this.initData();
			}			 
		},
		created() {
			_self = this;
			/*this.$nextTick(() => {
			    this.initData();
			})*/
		},
		
		methods: {
			initData:function(){
				this.showList=true;				
			},
			goDetail:function(id){
				uni.navigateTo({url: this.detailUrl+"?id="+id});
			},
			
			
		}
	}

</script>

<style>
	@import 'app-page-list.css';
</style>
